package com.swa.facebookdownloader.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/****************** Developer Roh.D.h ********************/
/*
 * Written 2012.12.20 Last Modified 2012.12.20
 */
public class SharedPreferenceUtil {

	public static void putStringSharedPreference(Context context, String key,
			String value) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putString(key, value);
		editor.commit();
	}

	public static void putbooleanSharedPreference(Context context, String key,
			boolean value) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putBoolean(key, value);
		editor.commit();
	}

	public static void putIntSharePreference(Context context, String key,
			int value) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putInt(key, value);
		editor.commit();
	}

	public static String getStringSharedPreference(Context context, String key) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		return prefs.getString(key, "");
	}

	public static boolean getbooleanSharedPreference(Context context, String key) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		return prefs.getBoolean(key, true);
	}

	public static int getIntSharedPreference(Context context, String key) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		return prefs.getInt(key, 0);
	}

}